Macros can’t check if you are feared, charmed or asleep. This would be too much automation. You wouldn’t even have to think you could just spam a button and right ability would be cast.
You can check if you are feared, charmed or asleep using lua code but you can’t cast spells using lua code.