Hi there ~
I understand your concerns. Smoking
marijuana may slow your healing time and therefore increase your chances of infection. I would believe your doctor when he advised you to not smoke marijuana for that reason. There are many other reasons why you should quit marijuana and primarily for the fact that it could be life threatening with causing variations in blood pressure and such. I strongly suggest that you consult a psychiatrist
who has experience in treating substance use issues. I hope you do so as soon as possible.
I hope this helps. Take care and have a lovely day!