I found how I wanted to do this in blueprint:
DetermineWeaknessValue.
IsAWeakOrProtectedValue.
Now I just need to convert it to C++. Do you know how?