Just curious, but if you added a line to the end of your creeps. Wouldn't that get you 99% of the way there? creep.memory.underAttack = creep.memory.hits > creep.hits; creep.memory.hits = creep.hits;