Can I change the damping value of a Shape in a Physics Asset at runtime?

I have set up some damping values for each of the shapes on my character’s Ragdoll, but I want to change them for some specific situations that arise during the game.

While doing some research, the first thing that caught my eye was the Physical Animation Profile, but this didn’t seem to be the feature I was looking for.

I tried to make the change via C++, but that didn’t work either, I’ve attached the code below. After this code worked, I looked at the value of BodyInstance->LinearDamping and saw that it had changed to the new value I had set, but when I looked at the movement of the actual character Ragdoll in the game, the changed value didn’t seem to affect the movement. (I tried setting a very high damping value to test it, but it still moved the same as it did with the smaller damping value before the change).

Could I be missing something? Any help would be greatly appreciated.

void UBlueprintFunctionLibrary::SetPhysicsAssetShapeDamping(USkeletalMeshComponent* SkeletalMeshComponent, const FName BodyName, float NewLinearDamping, float NewAngularDamping)
{
	if (IsValid(SkeletalMeshComponent))
	{
		UPhysicsAsset* PhysicsAsset = SkeletalMeshComponent->GetPhysicsAsset();
		if (PhysicsAsset)
		{
			FBodyInstance* BodyInstance = SkeletalMeshComponent->GetBodyInstance(BodyName);
			if (BodyInstance)
			{
				BodyInstance->LinearDamping = NewLinearDamping;
				BodyInstance->AngularDamping = NewAngularDamping;
			}
		}
	}
}