From history it seems that you have got wrong ideas about your problems connecting with your night fall, masturbation
in the past.
No bad effects on the body can have due to this habit.
In fact you got some chronic infection in GI tract causing these problems.
Go for one ofloxacilin, tinidazole
combination medicine course for 3-5 days.
tablet for few days.
Avoid fried, chillies and junk food.
Ok and take care.