Define placeholders for recurring snippets (code blocks, inline JS...) inside a note

Maybe I’m just a little slow and this is already doable, but I would love a plugin allowing for the definition of “variables” containing text snippets, regardless of whether they’re plain text, code blocks, inline fields, HTML or anything else. The idea would be to gain readability in notes that rely a lot on code.

A typical use case for me would be my DnD character sheet, which contains more than a hundred esoteric Meta Bind inline fields. When I edit it in source mode it can be pretty hard to read:

|                       |              #stuckBas               |                     M                      |                     S                     |                       |                                      |                     M                      |                     S                     |
| --------------------: | :----------------------------------: | :----------------------------------------: | :---------------------------------------: | --------------------: | :----------------------------------: | :----------------------------------------: | :---------------------------------------: |
|        **[[#Force]]** | `INPUT[number(class(DnDStats)):FOR]` | `VIEW[+{bonusFOR}][text(class(DnDStats))]` | `VIEW[+{bonusFOR}][text(class(DnDStats))]` | **[[#Intelligence]]** | `INPUT[number(class(DnDStats)):INT]` | `VIEW[+{bonusINT}][text(class(DnDStats))]` | **+`VIEW[{bonusINT}+{bonusMaitrise}][(class(DnDStats))]`** |
|    **[[#Dextérité]]** | `INPUT[number(class(DnDStats)):DEX]` | `VIEW[+{bonusDEX}][text(class(DnDStats))]` | **+`VIEW[{bonusDEX}+{bonusMaitrise}][(class(DnDStats))]`** |      **[[#Sagesse]]** | `INPUT[number(class(DnDStats)):SAG]` | `VIEW[+{bonusSAG}][text(class(DnDStats))]` | `VIEW[+{bonusSAG}][text(class(DnDStats))]` |
| **[[#Constitution]]** | `INPUT[number(class(DnDStats)):CON]` | `VIEW[+{bonusCON}][text(class(DnDStats))]` | `VIEW[+{bonusCON}][text(class(DnDStats))]` |     **[[#Charisme]]** | `INPUT[number(class(DnDStats)):CHA]` | `VIEW[+{bonusCHA}][text(class(DnDStats))]` | `VIEW[+{bonusCHA}][text(class(DnDStats))]` |

It would be great if I could have an abstraction layer so that, for example, every occurrence of **+'VIEW[{bonusINT}+{bonusMaitrise}][(class(DnDStats))]\' would be replaced with something like {IntelModifierWithProficiency}.

The note would then be “compiled” before it’s rendered by Obsidian, and the non-compiled version would be stored somewhere and reopened whenever I open that note with the plugin enabled.

Does something similar already exist somewhere? I mean, it can probably be done with Templater but not in a way that would make it practical for the use case I’m describing.