I think in the first snippet, the problem is a misunderstanding on how those events work.
The mouse event is a trigger, so it is only executed when the left mouse button is clicked. So far so good...
The following event is not a trigger, so it is executed every tick. That means that as soon as CanAttack is set to false the first time, the actions for CanAttack = false start executing every tick.
So every tick you have this timer being setup to wait for 1 second and after that setting CanAttack to true.
The problem with all of that is that by the time CanAttack is set to true the first time, a whole bunch of other Waits for 1 second actions have also been set up, and after each of those finishes, CanAttack will be set to true, making it seem the clicks are not setting CanAttack to false.
If I understand correctly, to get the behaviour you want, you need to place all the actions in the Mouse trigger. That way CanAttack is set to false, then you wait for 1 second and after the wait is done you set CanAttack back to true. Because everything is in the trigger it will only happen when the mouse is clicked.