Stop animationClip when use StartCoroutine problem

i have a condition that control play animation of character as below

bool isFinishedAttack = true;
void Update(){
    if(isFinishedAttack ){
         isFinishedAttack = false;
         getComponent<Animation>().Play("AttackBow");
         StartCoroutine(attackCountDownTime(2f));
     }
}

IEnumerator attackCountDownTime(float second){
		yield return new WaitForSeconds (second);
		if(isFinishedAttack == false)
			isFinishedAttack = true;
}

my animation clip doesn’t play full lenght of it. how can i fix this problem ?
Thank!

float seconds = 0.5f;
bool isFinishedAttack = true;

void Update(){
     if(isFinishedAttack ){
          isFinishedAttack = false;
          StartCoroutine(attackCountDownTime(seconds));
      }
 }
 
 IEnumerator attackCountDownTime(float a){

           animation["Animation name"].speed = animation["Animation name"].length / a;

         getComponent<Animation>().Play("AttackBow");
         yield return new WaitForSeconds (a);
        
         isFinishedAttack = true;
 }