Welcome to HCM.
Even though the history is long, the answer may not be as long.
Nothing usually gets damaged by masturbation
. It is mostly in the mind.
Things needed are---
1. Counseling by a psychologist/ psychiatrist
to get the confidence back.
2. A physical examination to check the organs.
3. Regular sex partner even though you may be afraid to start one- that will make a lot of difference.
4. Medicines to get better erections to given on demand.