No one can address your moral culpability. We simply cannot judge your interior life to that extent.
Having said that, I’d like to give my opinion on something.
While it’s true that force of habit can diminish the culpability of a particular sin, it is also true that (a) we have some responsibility for the habits we’ve formed and (b) we are responsible for how much or how little we’ve tried to overcome our habits, including the extent to which we’ve sought professional help when needed and when possible.
Especially with regard to point (b), we could point to two types of people.
On the one hand, there’s the person struggling with masturbation who has a support and accountability group in place, who attends psychological therapy, who has a means in place to make access to porn nigh impossible, but who nonetheless falls on occasion, but who has done what they humanly can, and who always puts up a sincere and prayerful fight.
On the other hand, there’s the individual who doesn’t want to masturbate, who always confesses it when they do it and who truly has a sincere purpose of amendment, but who has done very little to actually overcome their habit in practical, natural terms, such as those described above.
The force of habit, and how it diminishes culpability, is certainly not the same in both of these cases!
Another point.
Truly and manifestly intending to commit a mortal sin – but yet not committing it for whatever reason – **is itself **mortally sinful, objectively speaking.
In the Mass, during the Confiteor, we confess to greatly sinning
in [our] thoughts and in [our] words
*Truly intending to commit a sin is a form of sinning in our thoughts.
*
Now, it could be the case that someone could begin the process of masturbation simply by turning on their computer to view pornography. Upon their machine turning on, they could be reminded of that lovely painting of Jesus they use as their desktop, and because of it feel so bad that they repent entirely and go off to do some good deed instead.
But this does not make them innocent.
They still sinned in their thoughts to the point that they began a process designed to directly lead to a particular mortal sin.
So, as always, I think the best advice is to go to Confession, and mention whether or not you think you had a true intention to commit this sin, or if you just sort of accidentally found yourself doing it, and then proverbially smacked yourself out of your stupor.
Also, if you have a great deal of trouble with this habit, I would certainly urge you to attempt to seek out professional help, so that you could find some therapies that can help you on a natural level.