The meaning of the fifth lay precept is to avoid a state of mind where one could easily break the first four precepts. Drinking alcohol and consuming drugs have no karmic effect in and of themselves as far as the ten good/bad deeds are concerned. Coffee, tea, different medicines, etc. don't make it any more likely to break the first four precepts, thus using or avoiding them is irrelevant to Buddhist ethics.
"While teachers of the middle way, mind only, transcendent wisdom, mantra, and other schools may have their own assertions, the fulfillment of those intentions is the same. There is not a single thing that is not contained within mind."
(Gampopa to Düsum Khyenpa, in "The First Karmapa", KTD Pub, p254)
“If you recognize the world of appearance and existence as the mind, realize the mind itself as empty, and have no grasping at the superiority of your realizations — this is the ultimate view."
(Chegom Dzongpa, in "The Book of Kadam", Wisdom Pub, p609)