Sorry Four Magic, I don't quite understand what did you mean by that, tried commenting those lines and even commeting only the "if" and the result is the same, limit will be still 500ms.
As far as I can understand from the code that part just initilalizes the "lastAttack" time incase it is 0...