Hi. It's working exactly as you programmed it to, the only issue is that it's not meeting your expectations. But enough philosophizing.
You can implement firing rate timing in different ways, I usually prefer to make it dynamically dependent on the variable, so that you can realize the improvement of firing rate in the game.
In your case it is enough just to reset the timer every second.
Thanks for your reply! unfortunately, the solution you posted does not work. as it just resets the cooldown every second, if you time your attack correctly, you can attack and it will instantly remove the cooldown allowing you to attack twice incredibly quickly. this makes the attack cooldown incredibly inconsistent. id like for it to take exactly 1 second from the frame that the player left clicks on, for the attack cooldown to reset.