Based on one of Bishop Fulton Sheen’s talks, there are 3 stages of sin.
The first stage is the act, committed either just once or occasionally.
The second stage is a habit. This is when a sin is committed regularly but one is not hooked by it.
The third stage is addiction. At this stage, one is a slave to the sinful behavior.
If you are in stages one or two, then prayer, holy hours, and the sacraments should be enough to rid you of the masturbation problem.
If you really are in stage three, a full-blown addiction, then you will not be able to stop by yourself. In addition to prayer and the sacraments, you will need counseling or a 12 step group or both. There is a self-assessment on the Sex Addicts Anonymous (SAA) website to help you make that determination.