for cooldowns, instead of
set -u6 %cooldown 1
I sometimes use
set -z %cooldown 6
That has the advantage of telling you how many seconds remain in the cooldown, making it easy to fire up a timer that will launch when the cooldown expires.
Just be aware that 6 doesn't always mean 6 seconds. If you set your cooldown variable with zero seconds past the minute, setting it with value of X seconds does not mean the variable disappears at X seconds past the minute.
alias cooldowntestZ {
if ($1 == 1) { set -z %cooldown 10 | echo -s cooldowntestZ1 %cooldown $asctime | .timer 1 0 cooldowntestZ 2 }
if ($1 == 2) { echo -s cooldowntestZ2a %cooldown $asctime | var %x 999999 | while (%x) { var %rand $rand(1,1000) | dec %x } | echo -s cooldowntestZ2b %cooldown $asctime | .timer 1 0 cooldowntestZ 3 }
if ($1 == 3) { echo -s cooldowntestZ3 %cooldown $asctime }
}
if you run this alias with: /cooldowntestZ 1
you'll see that no matter how many seconds it takes during step#2, the cooldown variable either stays at 10 or notches down to 9.
This will happen regardless whether you're using -u or -z, as you can see from /cooldowntestU 1
alias cooldowntestU {
if ($1 == 1) { set -u10 %cooldown 10 | echo -s cooldowntestU1 $var(%cooldown,1).secs $asctime | .timer 1 0 cooldowntestU 2 }
if ($1 == 2) { echo -s cooldowntestU2a $var(%cooldown,1).secs $asctime | var %x 999999 | while (%x) { var %rand $rand(1,1000) | dec %x } | echo -s cooldowntest2b $var(%cooldown,1).secs $asctime | .timer 1 0 cooldowntestU 3 }
if ($1 == 3) { echo -s cooldowntestU3 $var(%cooldown,1).secs $asctime }
}