The semen consists of spermatozoa
manufactured in the testis. The viscous liquid that is ejaculated does not come from testis. It is made in other glands, predominantly the seminal vesicles. Spermatozoa from the vas deferens and the seminal fluid from the seminal vesicles meet and through the prostate
via ejaculatory duct
it reaches the urethra. At mydoctortells.com you can see this: picture-all-male-genital-parts-named/. During sexual arousal there is semen, which is just waiting to spurt out. Congestion thus caused is sensed as pain in the lower abdomen (in your case) or in between the scrotum
and the anus. There is stretching kind of discomfort that is peculiarly relieved on masturbation
This does not need any medication. It requires that you clearly understand that masturbation does not cause any harmful effect whatsoever. It is the best method of practicing 'safe sex'. With this scientific knowledge you will not force yourself to avoid masturbation. Then there will be no congestion and stretching or pain sensation.
If you have further doubts or additional queries feel free to ask here.
Dr. Ashok Koparday