How to refer to the health component of a character in C++?

How could I refer to the player class’ health value from the health component? Because I tried and it doesn’t seem to work as when I refer to it, it refers to the health component class and not the player class’ health so I always get the default value of health and not the players current health.

Player.CPP

//Health is the instance of the HealthComponent
void APlayer::Shoot()
{
	FHitResult Hit = InstantShot();

	APlayer* Target = Cast<APlayer>(Hit.Actor);
	if (Target && Target->IsAttackable)
	{
		DrawDebugBox(GetWorld(), Hit.ImpactPoint, FVector(10.0f, 10.0f, 10.0f), FColor::Green, false, 5.0f);
		Target->Health->OnTargetHit();
	}
}

HealthComponent.CPP

UHealthComponent::UHealthComponent()
{
	// Set this component to be initialized when the game starts, and to be ticked every frame.  You can turn these features
	// off to improve performance if you don't need them.
	PrimaryComponentTick.bCanEverTick = false;

	DefaultHealth = 100.0f;
	HP = DefaultHealth;
}

void UHealthComponent::OnTargetHit()
{
	GEngine->AddOnScreenDebugMessage(-1, 1.0f, FColor::Green, FString::SanitizeFloat(HP));
}

I wouldn’t directly call a function of a component from actor and instead would bind it to actors on hit from health component. You can add a damage parameter to fix it easily.

void UHealthComponent::OnTargetHit(float Damage)
{
     // FIRST DEAL YOUR DAMAGE!
     HP -= Damage;
     if (HP < 0) { HP = 0; }
    
     //  ... other stuff
}

Thanks for you recommendation but I got it to work a while back. The problem was that I was setting the health in the constructor so it didn’t matter if I changed the health in the editor(DefaultHealth is a UPROPERTY) cause it wouldn’t set the health to the changed value as it was already set to 100 from the start.
So I ended up using:

HealthComponent.CPP

void UHealthComponent::BeginPlay()
{
	Super::BeginPlay();

	if (DefaultHealth == 0.0f)
	{
		DefaultHealth = 100.0f;
	}

	HP = DefaultHealth;
}

This way I can set it in the editor and if I don’t set it it’ll set it to 100 by default.