Described is a system for treating traumatic memories. During a wake stage, a virtual environment is displayed to a subject. A traumatic episode that may be similar to a traumatic memory of the subject is displayed to the user in the virtual environment in a benign setting. A transcranial current stimulation (tCS) controller applies a pattern of transcranial direct current stimulation (tDCS) to the subject during the traumatic episode, such that the traumatic memory in a benign setting is associated with the pattern of tDCS. During a sleep stage, if slow-wave sleep in the subject is detected via electroencephalogram (EEG) recordings, then in a first time period, the tCS controller may a transcranial alternating current stimulation (tACS) to the subject followed by a second time period without stimulation. In a third time period, the tCS controller may apply the pattern of tDCS to the subject. The sleep stage may be repeated until a desired weakening of the traumatic memory is reached.