Jump Buffer not working

Hi, new to Unity and programming in general.
I’m trying to implement coyote time and jump buffer on a 2D side scroller. Coyote time seems to be working, but the jump buffer part doesn’t.

When I press jump right before hitting the ground the character doesn’t move up, even tough the Debug.Log set within the jump function is getting printed. My jump function is called salto(), I’ve copied it below. Since the function is getting called I believe the logic must be correct, but I’m guessing the unexpected result has something to do with the way I handle forces, but I really don´t know. I don´t fully understand the different movement types yet. I’ll be grateful for any advice.

I have this variables (sorry for the spanish):

public float velocidadSalto;
public float ultimaVezEnElPiso = 0;
public float changuiParaSaltar = 0.3f;
public float ultimaVezQueSaltamos = 0;
public float tiempoExtraParaSaltar = 0.3f;

This is what I´m doing on update:

void Update ()
    if (Input.GetButtonDown("Jump")) { ultimaVezQueSaltamos = tiempoExtraParaSaltar; }
    
    if (CheckGround.isGrounded) { ultimaVezEnElPiso = changuiParaSaltar; }
    
    ultimaVezEnElPiso -= Time.deltaTime;
    ultimaVezQueSaltamos -= Time.deltaTime;
}

On fixed update:

void FixedUpdate()
{
    if (ultimaVezEnElPiso > 0 && ultimaVezQueSaltamos > 0)
    {
       Salto();
    }
}

This is the jump function:

void Salto ()
{
    RB2d.AddForce(Vector2.up * velocidadSalto, ForceMode2D.Impulse);
    enelAire = true;
    ultimaVezEnElPiso = 0;
    ultimaVezQueSaltamos = 0;
     
    Debug.Log("saltamos");
}
void Update()
{
    if (Input.GetButtonDown("Jump"))
    {
        ultimaVezQueSaltamos = tiempoExtraParaSaltar;
    }

   if (CheckGround.isGrounded)
   {
        ultimaVezEnElPiso = changuiParaSaltar;
    }
}

Put physics related calculations in the FixedUpdate !

void FixedUpdate()
{
    ultimaVezEnElPiso -= Time.fixedDeltaTime;
    ultimaVezQueSaltamos -= Time.fixedDeltaTime;

    if (ultimaVezEnElPiso > 0 && ultimaVezQueSaltamos > 0)
    {
        Salto();
    }
}

You should clear the vertical velocity of the RigidBody before applying the jump force. This can help prevent unexpected behaviour caused by conflicting forces.

void Salto()
{
    RB2d.velocity = new Vector2(RB2d.velocity.x, 0); // Clear vertical velocity before jumping
    RB2d.AddForce(Vector2.up * velocidadSalto, ForceMode2D.Impulse);
    enelAire = true;
    ultimaVezEnElPiso = 0;
    ultimaVezQueSaltamos = 0;
    Debug.Log("saltamos");
}