Thanks for your query.Based on the facts that you have posted it appears that you have been indulged in frequent masturbation
since last 12 years.
First of all there is myth in a mind of common man that excessive masturbation is the reason of all sexual problems But I would like to state that it has been discussed in scientific forums all over the world and proved scienificaly that masturbation does not have any negative effect on any organ or system in the body.All the problems that you are facing now are mind related and due to anxiety
Following measure will help you to boost up your confidence and getting good erection.
1) Practice regular exercise for 45 minutes followed by meditation
for 1/2 an hour in the morning.
2) Take high protein diet rich in vegetables and fruits and Vitamin A
3)Take anti oxidants like Almonds 5-6 everyday..
4) Avoid alcohol and smoking
There is no reason why you should not impregnate your wife or you should not enjoy your sexual life in future.