User blog comment:Xilinoc/Ch. 596 - Rubb-Dolls 3/@comment-5693502-20140910133132/@comment-5693502-20140910160547

Well Mayuri is a master scientist, especially in the biological field. He did see her ready to use her powers on Ikkaku and Yumichika, confirming what her powers were. Then he saw the variation of skin colours in her different 'zombies' (High-level darkened skin, low-level normal skin). From that, and the fact that he is very good at theorising, he could've worked out how to counter her ability.