I just thought maybe this could be interesting to share. I'm not sure if I'll share this much code in the future, but I think it provides a bit of a view into how things work and what goes into designing a boss fight like this.
Honestly, a fight doesn't take that much code. Most of the time and effort goes into just fighting the boss over and over and over again and tweaking values until things feel right.
I initially designed and did the first balancing pass of this boss fight using a level 7 character, but I consider the fight very challenging at level 7. A more appropriate level range would probably be 9-11, and she's still an optional "super" boss, so don't expect her to not be able to kill you at those levels if you're caught lacking.
I often use slightly under-leveled characters to design fights because the amount of time I spend playing this game, combined with my forbidden knowledge, makes me a poor judge of how challenging anything is, lol.
I always have fun designing boss fights, and this one was no exception! She was a bit controversial, but I think that's just because a lot of players wandered into the fight unaware that she was meant to be very challenging.