As a disclaimer, WoW Classic uses the same macro system as main WoW.
There is no option in the macro system that allows checking for cooldowns. Macros aren't Lua, they're a simple set of conditions processed by a C function within WoW's UI. An arbitrary system made by Blizzard that's effectively just feeding a string into a parser. You won't be able to do anything related to casting in combat with Lua.
Concerning your specific issue, you can make a castsequence, but that would require two key presses.
Check out this old version of the Macro_conditionals article on Wowpedia:
https://wowpedia.fandom.com/wiki/Mac...?oldid=5632549
I'm linking an old version because someone completely gutted the article into a sterile environment of tables just listing conditionals, while this old version contains a ton of great explanations and examples to help you out.
You can also check out the Making_a_macro article:
https://wowpedia.fandom.com/wiki/Making_a_macro