I am trying to do command blocks for a map this kid in my class but have got stuck on a particular part. So what I am trying to do is every 20 game ticks effect them with instant damage then reset the scoreboard counter but only while they are within a 2 block radius of a Armour stand named damage-radius (that is also the scoreboard name) The problem I'm having is when 1 person is within that radius it adds to the scoreboard of all players thank you in advance here is what I have done already these are running in chain command blocks that are always active with command 2 and 4 being conditional also im pretty sure the command is in the 2nd command block
execute @a ~ ~ ~ /testfor @e[name=damage-radius,r=5]
/scoreboard players add @a damage-radius 1
/effect @a[score_damage-radius=20,score_damage-radius_min=20] minecraft:instant_damage 1 1
/scoreboard players set @a[score_damage-radius_min=20] damage-radius 0