It depends on how complex you want it. For example, if you want your current speed to be transferred to your swing speed upon grappling, it takes a bit of complex math. However, a simple going back and forth is rather simple. I'm currently working on an example of the former.
EDIT: Also, just thought I'd mention; I don't think I have my original example anymore, but it was kind of crappy anyways, so it needed to be redone.