Haven't tested, but should be what you're looking for.
local combat = Combat()
local config ={
bossName = "Demon" -- Boss name here
}
function onCastSpell(creature, variant)
local spectators = Game.getSpectators(creature:getPosition(), false, false, 7, 7, 7, 7) -- (7,7,7,7) is how...