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).

https://gist.github.com/michaelpb/b150f26e2efb30fb557741645c6c1436.js

Released into Public Domain.