Dynamically change functions

Good Day!

I have an issue with Enhanced Input system.
I have two types of wepons: a ranged and a melee type. Each type consumes same input (Right or Left mouse button) and triggers same base class function but each type consumes different InputEvent:

// For Range Weapon
  void ABaseRangeWeapon::LeftClickAction(EInputEvent Event)
  {
	switch (Event)
	{
	    case EInputEvent::IE_Pressed:
			Load();
			break;
		case EInputEvent::IE_Released:
			Release();
			break;
	}
}

// For Melee Weapon:
void ABaseRangeWeapon::LeftClickAction(EInputEvent Event)
{
    Attack();
}

Is it possible to bind and remove action bindings dynamically based on the current type of weapon?
I want to change my weapon and code removes previous weapon type functions and bind the ones of the current one

There is another approach to do this.

void AMyPlayerCharacter::LeftClickPressed()
{
    EquippedWeapon->ActionPressed();
}
void AMyPlayerCharacter::LeftClickReleased()
{
    EquippedWeapon->ActionReleased();
}


ARangedWeapon::ActionPressed()
{
    Load();
}
ARangedWeapon::ActionReleased()
{
    Fire();
}

AMeleeWeapon::ActionPressed()
{
    Attack();
}
AMeleeWeapon::ActionReleased()
{
    // Do nothing
}

Just by calling the function of the weapon, the code is cleaner and no need to worry the event binding.