Perhaps you are working on an action game or action RPG where different abilities need different cooldowns, but here's a tiny snippet that can be a re-usable Cooldown utility to check for when abilities can be re-used. Also useful for "rate-limiting" in general, e.g. adding a maximum rate of fire.

The top part would go into a Cooldown.gd file, that you then include in another file to use as a class (the bottom part shows example usage).

Released into Public Domain.