You can't use Monster:setStorageValue() so you would have to use a global variable (ex Game.setStorageValue(x, value))
Create a table with the monster names (if you want it to be for all monsters) with a value or use the monsters unique id:
Lua:
x = {
[1] = 1000, -- demon
}
local monsterId = monster:getId()
x[monsterId] = value
if x[monsterId] == value then
...
end