Hello
I don't think this works as a plugin, but only as a mod.
In theory, it would work. But it's a bit more complicated.
You have to program it / you have to program it. You have to rename a book, you have to ask whether it is in the anvil with an item and then you have to determine the function. There will surely not be such a plug-in to create, that would be far too complex.