How to code in a wait period between an action

Hi, In my game, the player has 100 health. If an enemy touches the player, the health goes down by 10. However, there is not wait period between the action (Im using OnCollisionStay) and so the health goes down nearly at an instant when the enemy is colliding with the player. That is why I want a wait period between the action (one second) so when the enemy is touching the player, the health of the player goes down 10 each second, instead of 10 each frame. I’ve tried searching for an answer for hours but still no luck.

using System;
using UnityEngine;

public class Enemy : MonoBehaviour
{
    public float health = 100f;
    GameController spawn;
    GameObject SpawnPointManager;
    GameObject playerParent;
    PlayerMovement playerScript;
    public int damageAmount = 10;

    private void Start()
    {
        SpawnPointManager = GameObject.FindGameObjectWithTag("spawnPointManager");
        spawn = SpawnPointManager.GetComponentInChildren<GameController>();
        playerParent = GameObject.FindGameObjectWithTag("firstPersonPlayer");
        playerScript = playerParent.GetComponent<PlayerMovement>();
    }

    public void TakeDamage (float amount)
    {
        health -= amount;
        if (health <= 0f)
        {
            Die();
        }
    }

    void Die ()
    {
        FindObjectOfType<MoneyScript>().GetMoneyFromEnemy();
        FindObjectOfType<ScoreScript>().OnEnemyKilled();
        spawn.enemiesKilled++;
        Destroy(gameObject);
    }

    private void OnCollisionStay(Collision collision)
    {
        if(collision.gameObject.tag == "Player")
        {
           
            if(playerScript.health > 0)
            {
                damagePlayer();
            }
           

        }
    }

    private void damagePlayer()
    {
        playerScript.health -= damageAmount;
    }
}
  • float ts = 0.0f;
  • private void OnCollisionStay(Collision collision)
  • {
  • if(collision.gameObject.tag == “Player”)
  • {
    • if(playerScript.health > 0)
  • {
  • if (ts < Time.timeSinceLevelLoad)
  • {
  • ts = Time.timeSinceLevelLoad + 1;
  • damagePlayer();
  • }
  • }
      • }
  • }

Thanks a lot, it worked