Macros can’t make decisions based on stuff like cooldowns. The only decisions that macros can make are based on the available conditionals. (So stuff like what you are targeting or your combat status.)
The macro essentials pin has a really good overview of what macros can and can’t do: