Ok I think I did it! Modified the class function to accept two arguments: $criteria and $cacheId, both with defaults that should maintain the plugin functionality.

The snippet now simply calls the class function with the arguments all nice and neat, and caches the output.