Haven't smoked dope in years. I found it rather demotivating, actually. I was the kind of "stoned person" who would just sort of lose track of time and think about what I wanted to do but never get off my butt to do it. Fortunately, I was never more than a very occasional, "take a couple of hits at a party" kind of user.
I was on and SSRI drug (prozac) off and on for a few years when I was battling depression. It didn't alter my thought processes, exactly, but it made me more emotionally resilient, and it helped with my overall energy level. I was still able to think, write and work when taking it. Actually, one aspect of depression for me is demotivation and being tired all the time, along with being too self-critical, so anti-depressants helped there. Depressed, nothing I write or create is anything but complete and utter crap to be tossed in the fire.
I'm not sure I'd have been able to finish grad school without the SSRI and the therapy I got.
These days, I have a strong cup of coffee first thing in the morning, and an occasional hot tea or soda later in the day. And now and again (no more than 1x a week) I'll have a beer or glass of wine. I don't think one drink has much effect on my writing (though I've never done a controlled experiment to test this). More than one does, however. Makes me fuzzy headed.
All of these drugs and medications are mind altering to varying degrees, but I don't think my use has tended to cross the line into what most people would call foolish. But medications and recreational substances are things that some people have strong feelings about. There are people who refuse to take ibuprofin or tylenol when they have a fever or a headache because they believe that they should be able to control the pain or discomfort themselves, or that experiencing it helps them grow in some way. I personally would rather take the drug (as directed) and feel better so I can get on writing pain free. But I'd be worried if I were regularly using a recreational drug or substance to motivate myself to write (as opposed to treating a symptom that was interfering with normal functioning).