I am not sure if I am missing something obvious here but I have the following code in an upgrade, with the intention of setting a maximum limit on a resource (Energy) - the tick is triggering fine, the if lines are triggering fine, but the toast confirms that despite the if lines triggering, $nrg is "0". I have tried $nrg=0.01, I have tried 0.1, no change - I just get a value of 0 each time.
if (100 >= Energy) $nrg = 0.01
if (100 >= Energy) toast [$nrg] here
yield $nrg Energy