I think that it is not the urge to masturbate that is really bothering me that bad, it is the urge to look at porn. I don't remember the last time I've seen porn, but the urge is there. Is there something I can replace porn with?
It might sound strange, but when you get a strong desire to see porn, you are best off masturbating (without porn of course). The desire to see porn means your seminal vesicles are getting full and your sex drive is rising. Once you ejaculate, that desire will suddenly disappear.
The reason you are feeling it as a desire to look at porn is because you associated ejaculating with pornography in the past and your brain is looking for a quick release of the tensions that you are ignoring.
After that, purposely find something non-sexual to focus on. "Finally, brethren, whatever things are true, whatever things are noble, whatever things are just, whatever things are pure, whatever things are lovely, whatever things are of good report, if there is any virtue and if there is anything praiseworthy--meditate on these things. The things which you learned and received and heard and saw in me, these do, and the God of peace will be with you" (Philippians 4:8-9).