You're NOTing the return of `get_active_hand` before comparing it with `holding`, which at this point should be guaranteed to be `null`.  Comparing `1` or `0` with `null` will always fail.  Make this `if(user.get_active_hand())` instead, and return `0` instead of `.` afterward.

Instead of adding the extra branch of `if` statements, you could just add `&& !holding == holdingnull` to the conditions.

The `!(user.get_active_hand() == holding)` should be shortened to `user.get_active_hand() != holding`, though it's not incorrect either way.

`var/holdingnull = !holding` would be briefer.

Why do all of the params except `delay` have `var/`?