To think I am eating my dinner reading this. There is nothing wrong with masturbation. I would imagine you found yourself unable to get hard and imagined the worst. Why you couldn't get hard. And your mind gave you all the answers. To back up what it thought was the right causes. Thus making it a frequent problem. Whereas, if you had of maybe thought of a few ideas as to why this could be occuring and didn't think negative about it, the problem wouldn't have become as bad. You are obsessed with it. Which wouldn't help. It is common to wake up hard in the morning. Morning wood as they call it. You get that way as you sleep. Stops you urinating as you sleep. The whole picture would lead to the lack of sleep. Depressed over not been able to get your hard on and the worry would all lead to no sleep, etc, etc. Good therapist should be able to put you right as far as your thinking on the matter is concerned.
First of all there is nothing wrong with masterbation, BUT your really want to ask yourself are you masterbating to avoid ................(fill in the blank). if not then have fun and enjoy,
Also you say you can stop at anytime, well then stop for awhile, I am pretty sure if you have been masterbating at once to twice per day, in quick time your body will get back to where you want to be.
we seem to forget that repeating the same thing over and over again CAN GET OLD!
take a run if you start getting the feeling to masterbate, but please take it one step at a time, give yourself a month or two (NO MASTERBATION) and see what comes up! (pun intended) also if you feel you can't wait that long, then see a Dr. because then there may be a problem, not with getting a erection, but with inner feels! good luck , keep us posted.