These are the questions you should ask your doctor, although I'm not sure how far you'll get with the one about how to masturbate to prevent it from recurring, but do ask and see if you get an answer. What you'd want to ask him as well is, did the masturbation have anything to do with it in the first place? And if it did, did you do anything extreme that might have caused it? But again, you've got a doctor's diagnosis and treatment plan and so he's the one to ask about how to fulfill that plan.