How do I add a cooldown timer to skills/inputs?

Thx it helped me add a cooldown for my fireball wich is consuming mana so i kinda just put what you posted in front of that mana consumption. It would consume mana eventhough the fireball wasnt shooting since it has a rather slow animation.