How does Damage work?

Hi,

The problem is that I don’t understand how to use the damage system in UE 4.
I have already read

but it didn’t helped me to use damage in c++.
It would be really nice if someone could explain it or show me a way to understand it.
Thank you realy a lot for any help : )

That you understand what I’m trying to achieve here is some pseudo code.
damage call:

UMyDamageType DMT = new UMyDamageType; // the class UMyDamageType int test
DMT.test = 10; // I'm setting test to some value
FDamageEvent FDE =   FDamageEvent::FDamageEvent(); // I am creating a new damage event
FDE.DmageType = DMT; // then I add my damage event object to the DamageEvent
this->TakeDamage(60, DamageEvent, GetController(), this); // then I call TakeDamage on this Object to test it
 float AActor::TakeDamage(float DamageAmount, struct FDamageEvent const& DamageEvent, class AController* EventInstigator, class AActor* DamageCauser)// her I override the TakeDamage function
{
	if(FDamageEvent.DamageTypeClass == UMyDamageType.GetClass) // if the DamageType class is from the class UMyDamageType
	hp -= DamageAmount + FDamageEvent.DamageType.test;// then use test to do something.
	return DamageAmount; // and retrun something.
}