How To Make Changes To Base UE4 Classes?

I want to change 2 functions in the Character.h and the CharacterMovement.cpp. They are:

Line 1717 in CharacterMovementComponent.cpp : FVector UCharacterMovementComponent::ConstrainAnimRootMotionVelocity
Line 361 in Character.h : FORCEINLINE class USkeletalMeshComponent* GetMesh()

Normally, I inherit from the base ue4 code and override the functions I want to, but Unfortunately, these two functions are not virtual so I cannot override them. How can I make changes to the base UE4 code? It seems to be separate from my project. Do I need to recompile the whole engine, or is there an existing solution I can modify?

Hello!