Parry Mechanic not working as desired

The Parry mechanic in my game works as follows:

  1. Player clicks block, 0.4 seconds until character reaches blocking position
  2. Character reaches blocking position. Player begins returning to idle position immediately if the block button was tapped or after the block button is released. It will take 0.8 seconds to return to the idle position
  3. A timer starts. Say the player clicks block 0.4 seconds after the character began returning to idle. The new parry window is this timer / 2 (so the characters time to transition from that position to block is the same as from that position to block when the block button was clicked from the idle position. I just want the return to idle animation to be double the length)

I created this mechanic expecting it to render parry spamming useless, as you would have a very small parry window. However, spamming the parry button still easily parries all the projectiles. I was wondering if this had something to do with my code here

public class PlayerScript : MonoBehaviour
{
    float playerHealth;
    float posture;
    float parryWindow;
    float parryTimer;
    float maxParryTimer;

    bool canBlock;
    bool blocking;
    bool parrying;
    bool timing;

    
    void Start()
    {
        playerHealth = 5f;
        posture = 2f;
        parryWindow = 0.4f;
        parryTimer = 0f;
        maxParryTimer = parryWindow * 2;

        canBlock = true;
        blocking = false;
        parrying = false;
        timing = false;
    }

    void Update()
    {
        // time from when block button released, or when block animation is over (in case of block being tapped and not held)
        if (timing == true){
            parryTimer += Time.deltaTime;
            if (parryTimer >= maxParryTimer){
                parryTimer = maxParryTimer;
                timing = false;
            }
        }

        // block button clicked and not actively blocking or mid block animation
        if (Input.GetKeyDown(KeyCode.F) && canBlock == true)
        {
            if (Mathf.Approximately(parryTimer, maxParryTimer)){
                StartCoroutine(Parry(parryWindow));
            }
            else{
                StartCoroutine(Parry(parryTimer / 2));
            }
        }
        // block button released when actively blocking
        if (Input.GetKeyUp(KeyCode.F) && blocking == true)
        {
            blocking = false;
            timing = true;
            canBlock = true;
        }
    }

    // function called when block clicked, begins blocking at end of parry window if block still held down
    IEnumerator Parry(float inputParryWindow){
        canBlock = false;
        parrying = true;
        yield return new WaitForSeconds(inputParryWindow);
        parrying = false;

        if (Input.GetKey(KeyCode.F)){
            blocking = true;
        }
        else{
            timing = true;
            canBlock = true;
        }
    }

    // when projectile collides with player
    void OnTriggerEnter(Collider other){
        // parried, blocked, or not blocked
        if(parrying == true){
            Debug.Log("parried");
            posture = 2f;
        }
        else if(blocking == true){
            Debug.Log("Blocked");
            posture -= 1f;
        }
        else if(blocking == false && parrying == false){
            Debug.Log("Hit Player");
            playerHealth -= 1f;
        }

        // update posture and health
        if (posture == 0f){
            Debug.Log("Posture broken and then restored");
            posture = 2f;
        }
        if (playerHealth == 0f){
            Debug.Log("Health Depleted and then restored");
            playerHealth = 5f;
        }
    }
}