Some of these tiles have to be set to priority so that Magus can walk behind the cliff but also on it (there's a ladder out of the screen). It works flawlessly out of battles, but it either can't work in battle or I don't know what commands/parameters to set to make it work.
I guess I'll set all the tiles in the center of the screen to priority, so that Magus will be entirely covered when he casts Lightning 2. It will probably be a bit weird, but it's better than having him partly covered. Out of battles, there will be no problem in any case.