I wonder if setting a timer, that is then queried in a condition is actually more efficient than just querying memory for the amount of time left. If it isn't just querying memory seems to be a better way in terms of fewer things to go wrong, and less overhead of extra variables.
I'm not incredibly skilled with macros, so I always tried to keep it as simple as I could. The more complex it became the more I felt like I wasn't able to keep my head above water in a lot of cases. Especially if I wasn't incredibly familiar with what a function did.
For example I have a healing macro that checks group average HP with a snipped I used from another macro I came across when I first got into scripting for MQ2, and I don't entire know how it works. It's always bothered me, but it worked for what I needed and just kinda let it slide.
I've used the timer method I mentioned for most of my emu experience since KA was iffy at best for them, and completely unresponsive at worst. So I could reliably find the duration of a buff or dot and hard set a timer every time the spell was cast.
Timer1 would equal 0 initially, once cast for a dot Timer1 would be set to 18000 (for example). During the dos rotation it would check if Timer1=0. If not, skip and cast something else.
Once combat ends and you receive an exp message or kill message set Timer1 to 0 again as a safety to ensure it would be available for the next pull.
I used the same method for buffs, but less involved since all that was required for that was to check for combat state and that timer=0.
It may not have been the best but I managed to get it to be reliable about 95% of the time. Those 5% situations being when a buff wouldn't land on a puller or DPS timer wouldn't reset on a no exp mob. Mostly non-issue situations.
I have some examples but am currently out of the house. When I get home I'll see if I can get what I used
@zathus to see if you might be able to cannibalize anything from them for yourself.