Thank you for asking. Your problem is suggestive of porn addiction and Compulsive masturbation. You must understand that like any other addiction problem, it must be treated by an expert. With suitable medications and instructions it can be completely cured. I would suggest you to consult with a sexologist.
Next Steps
For more information and specific suggestions you must consult with a sexologist. You can ask a detailed query here on practo.
Health Tips
Don't worry. It is treatable.