How do i delay the first attack after getting Line Of Sight with an enemy?

Basically i want my Unit to have a delay when switching Targets, or when first attacking an enemy, imy implementation already has a cooldown in between attacks but i want it to have a delay as if getting ready to attack a new enemy.

       void Update()
        {
            Collider[] inRange = Physics.OverlapSphere(transform.position, 50f);
            int i = 0;
            while (i < inRange.Length)
            {
                if (inRange_.tag != transform.tag && inRange*.tag != "LEVEL")*_

{
RaycastHit LineofSight;
if (Physics.Raycast(transform.position, inRange*.transform.position- transform.position, out LineofSight, range))*
{
if (LineofSight.transform.tag != gameObject.tag && LineofSight.transform.tag != “LEVEL” && (Vector3.Magnitude(inRange*.transform.position - transform.position) <= MinDistance))*
{
MinDistance = Vector3.Magnitude(inRange*.transform.position - transform.position);*
Target = LineofSight.transform.gameObject;
canSpotEnemy = true;
hasTarget = true;
}

}
}
i++;
}
if (hasTarget)
{
Attack(Target);
hasTarget = false;
Target = null;
MinDistance = Mathf.Infinity;

}
}

void Attack(GameObject target)
{
Health health = target.GetComponent();
if (health != null && Time.time-attackTime+attackRampup > 0 )
{

attackTime = Time.time + attackCooldown;
health.TakeDamage(attackDamage);
Debug.Log(target.name + transform.gameObject.name);
Debug.DrawRay(transform.position, target.transform.position - transform.position, Color.green);
}

}

You could add a public value for how long to wait upon spotting a target, then use the same system as cooldown using that value. If you want the two to stack, you can simply add it to the current cooldown value. If you’re using a coroutine, you can declare a Coroutine instance, assign your coroutine to it, then stop and restart it with the relevant time.