Hello,
First of all find out the cause of excessive masturbation. It could be because you are bored, lonely, hurt, stressed, or it could be because of pains from the past. Identify the time when you indulge in masturbation frequently. If supposing it is at night then exercise just before going to bed. Exercise will also help you to be more tired and fall asleep faster. Try to identify and focus on activities that make you feel better. Motivate yourself to do things for yourself. Talk with your friends and family and join a gym along with your friends so that you spend maximum time outside where you cannot indulge in masturbation.
It is very difficult to precisely confirm a diagnosis without examination and investigations and the answer is based on the medical information provided. For exact diagnosis, you are requested to consult your doctor. I sincerely hope that helps. Take care and please do keep me posted on how you are doing.
Your question is not clear enough to reply?