how to make a independant timer that only works when the function is false

hello, i am fairly new to unity and have encountered this problem with my dash

        Debug.Log(dashcount);
        Debug.Log(dashCD2);
        Debug.Log(dashCD1);

        if (dashcount <= 0)
        {
            dashcount = 2;
            Debug.Log("2");
        }

        //dash Main
        if (Input.GetKeyDown(DashKey))
        {
            //counter
            if (dashcount == 2 && dashCD1 == true)
            {
                DashChance1.interactable = false;
                dashcount--;
                Dash();
                pm.Dashing = true;
                dashcount -= 1;
                dashCD1 = false;
                Debug.Log("minused");
            }
            if (dashcount == 1 && dashCD2 == true)
            {
                DashChance1.interactable = false;
                dashcount--;
                Dash();
                pm.Dashing = true;
                dashcount -= 1;
                dashCD2 = false;
                Debug.Log("minused");
            }
        }
        //dash timer
        if (DashCDtimer > 0)
        {
            DashCDtimer -= Time.timeScale;
        }

        if (dashCD1 == false)
        {
            Debug.Log("true;");
            Invoke("Dash1", 3);
            DashChance1.interactable = true;
        }
        if (dashCD2 == false)
        {
            Invoke("Dash2", 3);
            DashChance2.interactable = true;
        }
    }


    private void Dash1()
    {
        dashCD1 = true;
    }
    private void Dash2()
    {
        dashCD2 = true;
    }

the problem that when dashCD = false; my game dosent show the debug.log(“minused”) any suggestions to fix it basicly my timer works before the whole function can run i still cant figure it out