So what I decided was that I would have the mana bar cycle through every player's mana value one player per tick, so that it would appear to "flicker" with the correct value. It is super ugly, but works when you have less than ten total players. The one I made changes once per tick but one changing every four ticks might be better, because then it would be flashing rather than flickering.
First, I set up an ID system, so whenever a player joins the game, the global ID scoreboard is incremented and the new player gets a new ID value. In this way, every player has a unique id number.
Then, I run this function, which uses recursion to get the next player who is online, once every tick. It adds one to the manaTimer value, resetting it if it reaches the player with the highest ID. Then, if the player with the current manaTimer value's ID is not online (or, stated differently, unless he is online), run the function again, increasing once per repetition, so it ends up at the next player who is online. In this way, if there's one player online it will stay on, if there's two it will flicker at 10hz, if there's 4 it will go at 5hz, etc. ID and manaTimer are fake players in the objective global.
scoreboard players add manaTimer global 1
execute if score manaTimer global >= ID global run scoreboard players set manaTimer global 1
execute as @a unless score @s playerID = manaTimer global run function dark_magic:tick_functions/get_next_player
Then, I have another function running once per tick. It has three commands, which first make the bossbar invisible to everyone, then store the currently displayed player's mana score in the bossbar, and finally make the bossbar visible to that player.
bossbar set minecraft:mana players @s[tag=nobody]
execute as @a if score @s playerID = manaTimer global run execute store result bossbar minecraft:mana value run scoreboard players get @s mana
execute as @a if score @s playerID = manaTimer global run bossbar set minecraft:mana players @s
It's not pretty, but it works. I will probably optimize it so it flickers at different speeds depending on how many people are online.