I know the fog was invisible, I'm saying that the moon being visible is actually accidental because you forgot a line of code. What you wanted to do is add the other Obj_SetVisible and then swap where you say alpha=255 and alpha=0.
alpha > 0 is an expression like you'd put in an if statement that resolves to either true or false. So you can use it directly like that instead of doing if(alpha > 0){ Obj_SetVisible(obj, true); }else{ Obj_SetVisible(obj, false); }
Or really you could just make everything more clear in the code by removing all the `alpha` stuff and have it be like
let frame = 0;
loop {
Obj_SetVisible(obj1, !bSpell); // Visible only when spell not active
Obj_SetVisible(obj2, !bSpell); // Visible only when spell not active
ObjSprite2D_SetSourceRect(obj1, 0, 0 + (frame*2) % -512, -512, -512 + (frame*2) % -512);
frame++;
yield;
}