optimize LuaInstance::get_action_state, LuaInstance::get_hook_state