Looks like your cast seem to be failing.
My suggestion is to change your approach, and let the AnimBP retrieve and read the state it needs to know about. In other words, you need a way to access the bool from within the AnimBP.
-
AnimBP has an event called Blueprint Initialize Animation, from there do a GetOwningComponent and cast to your BP_Sword_Component, save this reference to a variable.
-
AnimBP also has an event called Blueprint Update Animation, from there you get the new reference of BP_Sword_Component that you created, and retrieve the bool you want. Save a copy of that bool to a new variable in the AnimBP. This will update the bool every animation update (not super efficient, but will work for your needs).
-
Then in the transition rule you can use the new bool variable you created.