You can use the select-until-plugin instead of filter-list-plugin
.
selectUntil = {import:select-until-plugin}
count = 0
output
[count = 0, acronymLoop]
// count = 0, to reset the counter for each generation
acronymLoop
[word = count < acronym.length ? (n = selectUntil(noun, i => matchFirstChar(i, acronym.charAt(count))), count++, "<span contenteditable>" + emphasizeFirstChar(n) + "</span> " + acronymLoop) : '']
// Instead of filter list, we use the select-until-plugin in which the 'test' to be used was the `matchFirstChar` function that you already have.
// We start at 0, then count up (`count++`)
// Then the check is now `count < acronym.length` instead of `count <= acronym.length` since we use zero-indexing with `charAt`.
You need to have them in square brakcets to ‘run’ them:
{[subAgilityMod = 1, '']|[subAction = advnonac, '']} // The (, '') just tells the square bracket to output nothing.