One way or the other, the individual in question must make every effort to break the habit. Even if, in some situation, a person was non-culpable for grave sins due to some sort of habit, they would be culpable for the mortal sin of not trying - or not trying hard enough - to break the habit.
And I would say, at least in my best estimation, that the day the individual is tempted by the sin and recognizes/feels the power to say no to it is the day that the individual is fully culpable for the act.
I think in cases like this, it is very important to give very cautious and prayerful counsel. Certainly the boy must be alleviated of any fears that might bind him. The boy must be given as much legitimate access to Holy Communion as possible. The boy must be made aware that God isn’t constantly angry with him. However, its also very critical that excuses and oppurtunities for the devil to work with aren’t allowed to make their way into the boy’s mind, either.
I had a problem with masturbation myself, once, and I talk to a few people who do currently in a sort of support role, and I can say that there is no question that any very simple advice, as the OP suggested was given, will not lead to any positive results.
The key to overcoming any sin, and especially active (as opposed to passive) sins like masturbation, is to be able to see through all the clouds of society and of our own feelings to realize how much power God actually has given us to stop it, and to come to recognize that the will really is in control of everything. The worst thing you can do is take all the responsibility away from a person.
The most important thing for them is to be made aware that it’s their choice and given some responsibility. In the case of a habit, it’s not much different. It’s harder for the person, and it takes more work because the will really needs to be brought back into the right alignment where it was before the habit formed. Also, the person has to be prevented from feeling imprisoned, lost, or frustrated. At its core, though, is to start to give the people responsibility. Even Alcoholics anonymous and other 12 step programs realize this. That is why they reject all ideas such as “alcoholism is a disease” and “I’m a victim” and others that take responsibility away from the person. Responsibility is the core. The thing with those caught in a habit is to get them to realize they have the control they do and give them the support they need to use that control. Grace, of course, is most important.