You cannot have sexual urge by force. Quit masturbating for some time and the urge will reappear. However, keep control. Enjoy each masturbation fully and in a relaxed manner.Do it when there is a real urge. Go for quality and not for quantity.
Yes, stress can be a factor with erection problems, if you are distracted by other issues.
How you masturbate makes a difference too. From what I know, moving your hand up and down the penis but not moving your penis (i.e. imitating penetration) is better. Moving your penis towards and away from your stomach, rocking it back and forth at it's base... don't ever do... my urologist thinks it was a contributing factor to the blockage I got in my artery that feeds the penis at the base.
Not that I do what I preach, but if you can, my personal feeling on it is to not masturbate at all. If that isn't possible, reduce as much as you can, and if you break down and have to sometimes, just note what I said above. I also think this would be especially important when your body is still developing, so at your age. Scarring in the penile tissue or elsewhere in the penis is an issue, and if scarring builds up to a significant extent, it will cause problems with erections. My own idea - and I'm not a doctor but I have had my own journey in this - is each time you masturbate, or at least do it wrong, you add some scarring. It's good you're identifying things at such a young age, so make sure you do things right from now on, so as to not develop a problem.
I've also been told that a good evaluation of the functioning of your penis / your erections, is to evaluate the hardness and fullness of your morning erections (when you wake up). Don't freak out if some days it's not full or some days there is nothing at all. But over a period of time, just evaluate. If you wake up with full hard erections, even if not everyday, that shows that you're doing well, so keep that up.