Masturbation cannot affect the penis size. Your complaints can be indicating towards a possible problem of Erectile dysfunction. A detailed information regarding these is needed to decide specific management plan.
Next Steps
I would suggest you to to consult with a sexologist for further management and detailed instructions. With suitable medications and instructions it can be completely cured.
Health Tips
Don't worry. It is treatable.