Only update lastAttackTime if we actually attack.

If the player is near the health threshold they will have a much longer delay before they actually attack. Setting it after the check allows the script to attack a little faster.