Thanks for the answer! Unfortunately, I will not be able to take advantage of your offer.
I don't know Lua. I can work a little with jQuery. Lua and JavaScript are a bit similar.
In my forks, I made the simplest changes: I corrected or added lines, removed code that I didn’t need, or added code from other related mods.
And here you need to prescribe a full-fledged function, which is too tough for me.
Sorry..