First of all remove all myths & misconceptions from your mind about masturbation.
In fact, Masturbation is completely normal & doesn't have any bad effect to the body and mind.
Regarding the problem of Erectile dysfunction
, it is due to decreased blood supply to the penis.
Tadalafil is pharmacologically a Phosphodiesterase inhibitor
, which dilates the blood vessels in the penis, increases the blood flow & maintains the erectile state of penis.
Presence of increased erections on taking the medication & flaccid state on discontinuation can be attributed to improper blood supply in the penile arteries.
Investigations like color Doppler study can be done to detect any organic cause.
Other than psychological, the reasons for difficulty in maintaining erection can be many such as Hypertension, Diabetes mellitus
of the arteries, Neurological problems, Chronic illness, Prolonged intake of drugs, Stress, Smoking, Alcohol, etc.
So, investigations like Complete blood count
, estimation of blood pressure & blood sugar levels, lipid profile will be helpful in this regard.
Wishing you a Healthy Life.