Alrighty, two issues here, first off the red lines are caused because cooldownCounter doesn't exist, it's you don't need to assign anything to it, you're just passing the value -1 into the function, so you can just put -1.
Secondly, the Function ByPlayer requires the index of the player killing to be passed into it, the variable for this is Player,whoAmI
Modified code:
player.Hurt(PlayerDeathReason.ByPlayer(player.whoAmI), 20, 1, false, false, false, -1);
Side note, the last 4 passed variables are the same as the default assignments so you can ignore them, the code comes out as:
player.Hurt(PlayerDeathReason.ByPlayer(player.whoAmI), 20, 1);
Hope this helps, -K