Coroutine not Working

I wanted the player to get damage every time they are close to the enemy with one damage per second, but the code does not load the delay.

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

	playerDistance = Vector2.Distance (player.position, transform.position);
	if (playerDistance < 2f) {
		StartCoroutine (Wait ());
	} else if (playerDistance > 2f) {
		StopAllCoroutines ();
	}
}

IEnumerator Wait (){
		player.GetComponent<PlayerHealth> ().HurtPlayer (damageToGive);
	yield return new WaitForSeconds (10);
	}		

}

Maybe something like this will work better for you.

    Coroutine damagePlayerCoroutine;
    WaitForSeconds waitASec = new WaitForSeconds(1f);

    void Start()
    {
        damagePlayerCoroutine = StartCoroutine(DamagePlayer());
    }

    IEnumerator DamagePlayer()
    {
        var playerHealth = player.GetComponent<PlayerHealth>();
        while (true)
        {
            var playerDistance = Vector2.Distance(player.position, transform.position);
            if (playerDistance < 2f)
            {
                playerHealth.HurtPlayer(damageToGive);
                yield return waitASec;
            }
            else
            {
                yield return null;
            }
        }
    }