Alright so I have skills in my current project that have cooldowns so they cannot be continuously used repeatedly. The thing is that the cooldown system works fine. It's just that if you activate the skill but you don't have enough energy, you're doing something, etc., the cooldown will still activate even though the skill didn't activate due to whatever reason. So for example. A player uses a skill but doesn't have the energy cost to use the skill, the player won't be able to use the skill 'til the cooldown is over even though skill didn't go through. Here is the code for the activation of the skill:
for(var/HK/H in usr.client.screen)
This code works perfectly fine for putting a limit to massing the Activate button but is there a way to make it so that if the skill doesn't fully activate because of not having a required stat or something, there won't be a cooldown? The last thing I'd want to resort to is setting a cooldown code into every skill.