Tankyou
I'm thinking adding and removing spellbook messes with cooldowns so probably instead what you should do is disable the spellbook ability for the player and enable it when you want it to become visable.
Please rep me for my drunken genious
EDIT: Oh, why won't it work? You just need 8 dummy abilities instead and 8 different hotkeys for the spellbooks.
Ye it will work because I understand what you're trying to do (i think).
The dummy spells will be so you can set a variable which will tell you which spellbook was opened
Hmm, there may be a problem when you try to detect closing the spellbook and replacing the book with the dummy ability. You can event from 'player presses ESC' but there is always the thing if you have spellbook open and instead of closing it u just select another unit. You could code that too I suppose.
Another alternate would be using the dummy abilities again but seeing as the spells inside the spellbooks are all the same you can just use another dummy unit which would have those spells.
So when dummy ability is pressed it will select your dummy unit (which has your 10-20-30-...... abilities)
Works almost the same way as spellbooks.