Score of entity needs to change under condition

I need Score(a) of an entity to change to 1 if Score(b) of the same entity matches Score(c) of a player and if that matching player is 5 or more blocks away.

Continue to help post