hey, first of all there is no habitual masturbation, only your technique could be habitual you use in stroking yourself. So this could be the safest sex if performed gently and carefully.
Only side-effect is you may lose the appetite to have sex with a partner if masturbate repeatedly or may get stains of blood in your semen so precautions should always be there against extreme.
Despite this you may disfigure you weapon if beat it badly. Otherwise its ok, be gentle with you weapon.
But if you want to avoid masturbation then you have to be a really strong will-powered man otherwise find a girlfriend or wife.