Activating a library ninjutsu ability while searching your library follows all the normal rules for activating an ability, except for timing (activating this ability always occurs during the resolution of another spell or ability). The ability goes on the stack. You have to pay the ability’s listed costs and any applicable additional costs, which means you can activate mana abilities while you’re activating a library ninjutsu ability even as you’re searching your library.