Poor calcium levels are common cause for symptoms post masturbation.
Increase calcium rich food in diet.
Avoid frequent stimulation. It leads to congested state and prostatitis and referred pain to tip of penis.
Merely for example to understand the situation I would suggest how eyeache happens after excessive crying and swelling of lacrymal gland. Similar issues happen here.
Avoid stimulation for few days
Stictly restrict your habit to once in 2-3 days and that too for short duration.
Hi..... Masturbation now is regarded as a normal, healthy sexual activity that is pleasant, fulfilling, acceptable, and safe. It is a good way to experience sexual pleasure and can be done throughout life.
Masturbation is only considered a problem when it inhibits sexual activity with a partner, is done in public, or causes significant distress to the person. It may cause distress if it is done compulsively or interferes with daily life and activities.
Consult sex therapist...