Hello 
 Thanks for your query.Based on the facts that you have posted it appears that you have  been indulged in 
masturbation frequently and now getting weakness and thinning of your legs.
You have doubt of these symptoms may be due to masturbation.
First of all there is myth in a mind of common man that excessive masturbation is the reason of all 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.or may be due to some other cause .
Following measures will help to boost up your level of confidence and allay anxiety and there by improve your sexual performance, 
1) Practice moderate exercise for 45 minutes followed by 
meditation for 1/2 hour. 
2) Take high protein diet rich in vitamins A,C,E,D.fruits and vegetables . 
3) Avoid alcohol and 
smoking . 
4)Take some anti oxidants like Almonds 5-6 everyday. 
For weakness in the legs consult qualified 
Neurologist for clinical assessment and further treatment.
Dr.Patil.