Psychiatry

A 20 years old female has thoughts of cutting her fingers, she plans and imagines doing it but never actually does it. She says that she is not having any guilt of having such thought. And also says the thoughts are distressing her and she is unable to control them. The thoughts vanish either by ending with a seizure or automatically subsides on its own. Which of the following is the cause?