How to use collision.name in custom function

So at the moment I’m suck trying to make a enemy stop after being hit. The problem is that I can’t use the collision.name because it doesn’t exist in the context but I also can’t put Collider2D as a parameter on the end of the function because I need the int damage there. So how would I be able to do this?

public void TakeDamage(int damage)
{
    anim.SetTrigger("hurt");

    if(collision.name == Hawk)
    {
        GetComponent<StopHit>().enabled = true;
    }
    health -= damage;
    if (health <= 0) 
    {
        Destroy(gameObject);
    }
}

one possible solution in here would be to overload you’re TakeDamage function if you still want to have TakeDamage(int damage) and do not change it.
you can overload this like this :

 public void TakeDamage(int damage, Collider2D collision)
 {
     anim.SetTrigger("hurt");
     if(collision.name == Hawk)
     {
         GetComponent<StopHit>().enabled = true;
     }
     health -= damage;
     if (health <= 0) 
     {
         Destroy(gameObject);
     }
 }