I've spoken to my doc and he said try masterbating 30mins before sex, it didn't work
That sounds like really dubious advice. It might help with the premature ejaculation problem, but it seems to be counterproductive with regard to the maintenance-of-erection problem. Every man has what's known as a "refractory period
," which, to put it concisely, is the amount of time between and orgasm and the next erection. For a sixteen-year old, the refractory period may be a matter of seconds. For someone your age, the time period would be longer -- how much longer I have no idea, but thirty minutes may not provide sufficient time for your much-abused best friend to recover.
Frankly, it sounds like you're in a negative-reinforcement feedback loop. You don't perform, so you worry about performing the next time, which causes you not to perform, which causes additional worry, etc. etc. etc. I don't like to recommend something this drastic, but in a serious case such as yours, I would suggest spending less time obsessing about your performance issues and more time relating to your girlfriend. In other words, the dreaded "C" word -- cuddling
. Just be with her, getting to know her body as she gets to know yours, without any rush to the sex part. If you become aroused, hold off for a while, let her find out what you like without any pressures to perform.
Right now, I don't think you need techniques, you need confidence. You don't overcome performance anxiety by becoming more anxious about your performance.