Enemy's initial attack doesn't deal damage to player

Good evening, I’m having an issue where any enemy my player first encounters attacks, the first attack doesn’t deal damage. However, subsequent attacks after that register the damage. I’m not quite sure why and was wondering if someone could help. Thank you!
Here’s my code for the enemy attacks:
private int damageAmount;
private int attackNum = 1; //attack index
private Animator anim;
private bool inAttackRange;
private bool isNear;
private float timeBtwAttack;
private float currentDistance;

[SerializeField] private float distance = 2f;
[SerializeField] private float startTimeBtwAttack;
[SerializeField] private Transform attackPos;
[SerializeField] private LayerMask whoIsPlayer;
[SerializeField] private float attackRangeX, attackRangeY;
[SerializeField] private int attack1, attack2, attack3;

private EnemyPatrol patrol;

private void Awake()
{
    anim = GetComponent<Animator>();
    patrol = GetComponent<EnemyPatrol>();
    timeBtwAttack = startTimeBtwAttack; 
}

private void Update()
{
    //is player in attack range
    inAttackRange = Physics2D.OverlapBox(attackPos.position, new Vector2(attackRangeX, attackRangeY), 0, whoIsPlayer);

    currentDistance = Mathf.Abs(transform.position.x - PlayerHealth.instance.transform.position.x);

    //check if distance from player is near
    if(currentDistance > distance)
    {
        isNear = false;
    } else
    {
        isNear = true;
    }

    if (timeBtwAttack <= 0)
    {

        if (inAttackRange && isNear)
        {
            patrol.enabled = false;
            //DealDamage();
            anim.Play("attack" + attackNum);
            timeBtwAttack = startTimeBtwAttack;
        }
        else
        {
            patrol.enabled = true;
        }
    }
    else
    {
        timeBtwAttack -= Time.deltaTime;
    }
    
}

private void DealDamage()
{ 
    if (isNear)
    {
        PlayerHealth.instance.TakeDamage(damageAmount);
    }
    if (attackNum == 1)
    {
        damageAmount = attack1;
    }
    else if (attackNum == 2)
    {
        damageAmount = attack2;
    }
    else if (attackNum == 3)
    {
        damageAmount = attack3;
    }
    
    attackNum++;

    if (attackNum > 3)
    {
        attackNum = 1;
    }

}
private void OnDrawGizmos()
{
    Gizmos.color = Color.blue;
    Gizmos.DrawWireCube(attackPos.position, new Vector2(attackRangeX, attackRangeY));
}

@Allurance
Your AttackNum is set to 1 at the start but if you call DealDamage() it will be put to 2 because of the attackNum++ that gets called without restriction. Set AttackNum to 0 at the start and when attackNum > 3

You could also clean it up a bit more and swap those ifs with a switch case like:

   private void DealDamage()
    {
        if (isNear)
        {
            switch (attackNum)
            {
                case 1:
                    damageAmount = attack1;
                    break;
                case 2:
                    damageAmount = attack2;
                    break;
                case 3:
                    damageAmount = attack3;
                    attackNum = 0;
                    break;
            }
            PlayerHealth.instance.TakeDamage(damageAmount);
            attackNum++;
        }
    }

Hope that works and I didn’t mess up somewhere.