You need to get the animation instance of the character you are on, the animation instance is owned by the skeletal mesh, named only mesh in the character
Cast to ThirdPerson_AnimBP is to be replaced with your animation bp class
casting self to anything is normally not necessary because it is already the most specific version of itself and it can be used as all its less specific versions.
e.g.
If you are on BP_MyCharacter a blueprint inheriting from Character you can use self as
BP_MyCharacter,
Character,
Pawn,
Actor
without needing to cast