This patient support community is for discussions relating to teen health, including abuse, acne and skin, alcohol and drugs, ADD/ADHD, exercise, growth disorders, infectious diseases, learning disorders, nutrition, piercings and tattoos, teen pregnancy, relationships, safe sex, sports injuries, STDs, vaccines, and weight loss.
When you say the "on the inside skin of my penis" I assume that you're not circumcised. You seem to be having a recurring problem with fungal infections. This is not uncommon in uncircumcised guys. The key to preventing them is to make sure you keep yourself really, really clean down there. Every day when you shower, make sure you pull your foreskin back completely and wash the head of your penis with soap. Then, when you're drying yourself off, pull it back again and dry it really well. The key here is to make sure you keep it clean and dry.
Masturbation isn't causing it, but it might be irritating it, making it more noticeable afterward.
Finally, promise me you won't do the unprotected sex thing again.