Creating a coyote jump with friction and acceleration

Godot Version

4.3

Question

I created new movement for a game I am making but in the process it broke my coyote jump and i wanted to know if there is any way to make a coyote jump still work while applying friction and acceleration to the playerbody2d

func movement(delta):
	input = get_input()
	
	# Handle sliding/friction only on the x-axis
	if input == Vector2.ZERO:
		if abs(velocity.x) > (wlk_friction * delta):
			velocity.x -= sign(velocity.x) * (wlk_friction * delta)
		else:
			velocity.x = 0
	else:
		velocity.x += input.x * wlk_accel * delta
		velocity.x = clamp(velocity.x, -current_speed, current_speed)

Here is how my friction is handled