If you think you can use same name to declare 2 different strings, then you need to learn some java.
When declaring strings, ints, booleans, give it a name so you know what it is about.
Example:
private final String cow = "Cow";
or you can create an array of strings and the script will look and find one of the monsters
private final String[] monsters = {"Lesser demon", "Cow", "Cow calf"};
In your getState() you could write
final GroundItem cowhide = groundItems.closest("Cowhide");
and
if(cowhide != null && cowhide.isVisible()) {
return state.TAKE;
}
Use this http://osbot.org/api/