Referencing 'Variables' from the AnimBP in a C++ script?

Thanks for the fast reply! I am taking a look at the link but it says ‘deprecated’ just to let you know.

To what you said about where the variable is created. I could always do it another way, but so far I just created the int Anim_state from inside the AnimBP. . I already have a variable with the same name in my cpp code that is working . You see he can only be in one of 4 anim states at any time, never blending, never any other states. So the enum is already basically a state-machine in my code.
So therefore I just want to ‘copy’ that value from my c++ code into the Blueprint on that I shown in the red circle in my picture.

If I create a “C++ AnimBP baseclass” as you say, does that mean to make a class that extends AnimInstance? Would you mind giving me more detail of how I should create the “C++ Anim BP”.

(Thanks for all your help Bruno you have saved me lots of time already with your kind help)