When we look into the mind of a prisoner of bad habits we find several truths.
One, you have acknowledged your problem in private though you may never want to acknowledge it in public. Breaking your habit is a major concern of yours, but you are unable to control the impulse to indulge in the self abuse.
Two, as in most bad habits, you cannot undo the time that you have lost by just stopping the practice.
Three, even though participating in the bad habit makes you feel good for the moment, you feel worse off afterward.
Four, you may be attempting to deal with boredom. Since there is nothing to do, you find something wrong to do which becomes a behavior pattern in your life. Or, you may feel like you deserve to do a little wrong. After all you have done so many good things, and worked hard, and you want to reward yourself with doing wrong. Or, the people you move with try to pull you down their path. They don't feel good about themselves when you are around them. Instead of becoming like you, they entice you with their offerings.
You have to wake up. Understand that you are evading the real issue, deceiving yourself, creating fantasies that will never be achieved. Your life is at risk, your mind is declining, and your faculties are expiring. The sins you sowed one by one, you will reap two by two.