I think I got it now. Thanks!
freeloop(true);
// Summon mobs and store their IDs
for (.@i = 0; .@i < .@amount; .@i++) {
.@mobGID = areamonster(.@map$, .@x1, .@y1, .@x2, .@y2, .@mob_name$, .@mob_id, 1, .@label$);
.@MAXHP = getunitdata(.@mobGID, UDT_MAXHP);
.@HP =...