generalized getState methot for plugins