How can i make target attacking with moving forward in paperzd?

After I completed the combo system, I realized that the final attack was awkward due to the positioning of the sprite itself. I thought I could use ans, so I approached it that way at first. However, I realized that it is not a simple problem because the distance the sprite moves and the actual distance the character moves must match, or the distance the sprite needs to move for each animation tick is different, so if i use ans, i have to use the cast function for the tick. How can I solve this problem?