Change bossbar name through scoreboard

Hi! So i am trying to change the title of a scoreboard dynamically trough a function so that it basically displays text followed by a player's scoreboard value. I figured that bossbars couldn't directly handle json like that, so I turned over to macros, but now, I can't figure how to pass a player's score through a macro argument. I am pretty new when it comes to using storages to, well, store data, so if anyone could tell me if macros is the simplest solution, and help with these problems, I would greatly appreciate it !

Continue to help post