From hhistory it seems that you might be having some infection, bacterial or yeast due to habit of having masturbation
as there is possibility of giving infection through finger or unhealthy nails.
Apply triple acting cream locally.
If require go for one antibiotic and anti-fungal medicine course.
Keep local hygiene clean and healthy.
There is possibility of breaking of hymen
due to this habit.
Ok and take care.