Once I've built momentum again I just cut out the alcohol entirely. It's kind of like a bootstrapping process, or perhaps boozestrapping..
I can't recommend anyone actually does this though, especially if you're prone to problems with alcohol. Personally, I've far more to fear from RTS games as far as addictions are concerned.
You are describing the ballmer peak (https://xkcd.com/323/). It's a joke, but some truth rings to it. Developing while dealing with anxiety can be crippling so a small amount of booze helps lubricate things.
That said it's easy to get into the habit of drinking very slowly, so never getting intoxicated, but the drinks still add up over the hours. You end up putting down a lot of excess calories not to mention the negative impact on your overall health if you drink 5-6 drinks over the course of a 10 hour coding session over and over again.
I've since found exercise works just as well and is much more sustainable. Something for you to keep in mind perhaps.