I stopped masturbating and watching porn for 12 days, but the past three days I would watch porn and edge to where I'm about to climax, but I don't and I stop myself. Today I did that again for the fourth time and when I went pee shortly afterward, my pee stopped then started again. Afterward I had two sharp pains that lasted two seconds and hurt badly. I realized that I needed to ejaculate so then I did and now the area about my penis below my stomach feels sore. I'm very worried I have a serious problem now with my prostrate or bladder, and I'm scared. I know that you say masturbation isn't a sin, but it feels like one, even if I don't think of lustful thoughts. I honestly feel like I've learned my lesson and now I'm going to face a bladder problem for the rest of my life.
First, notice what you did. I gave you material that proved that pornography was a sin and that masturbation by itself was not a sin. But what did you do? You stopped masturbating and when your need to ejaculate got strong you looked at pornography. Do you see how you got involved in sin while attempting to avoid something that is not called a sin by God?
I need to explain what happened. You have a muscle down by your prostate gland. If you notice there are two tubes that come together there -- one from the bladder and the other from the ejaculatory duct. The muscle acts like a railroad switch. The normal state is for the tube from the bladder to be open and the one from the ejaculatory duct to be closed. When you are aroused, the tube from the ejaculatory duct is open and the tube from the bladder is closed.
What happened was that you were sexually aroused, but your bladder was full. The tube from the bladder was closed. You pressed hard and forced the urine through, but that injured the muscle. Once enough of the pressure was relieved, it clamped down again. But, of course, it hurt from being forced to open. The ejaculating afterwards caused the muscle to squeeze when it was already sore, which just made it more sore.
The good news is that the soreness will go away in a day or two. Meanwhile, when you need to urinate, wait for your body to relax. If you are aroused, start doing something boring in your mind, like math problems. Once you've calmed down, you won't have any problems urinating.
Oh, and stop looking at pornography; that is a sin.