Problems with Grapple/Hookshot Math

Hi,

I’m trying to get a grapple mechanic together that pulls my character up towards it (sekiro style). Here is what I have so far.


!

Im terrible at understanding what type of math is needed to do this. This is what I have so far using sources on the internet. This currently makes me swing but i’m trying to get more of a “hook and pull to” style like sekiro. With sort of a “fling” at the end.

Any help is greatly appreciated, thank you!