The best way to stop masturbation is to just stop it.
No other ways around it, no tricks.
Just grit your teeth through sleepless nights
and battle your urges till the morning sun rises.
This was my approach, and after a week of no masturbation, the urges subsided and it's become bearable.
Just a week of extreme patience and you'll feel the difference.
But of course, you have to intentionally avoid all images of girls during this time and until reboot is complete.