What I think happened:
Danzo was suspicious of the Uchiha after the fox attack, but he lacked evidence to do anything.
Shisui was ordered by Danzo use Kotoamatsukami on the clan so that they would plan a Coup.
Itachi was Shisui's friend, He looked up to him. Itachi found out the plans & convinced Shisui to correct his mistake.
Then he tried to use Koto again so the clan would stop their plans, but instead Danzo stopped him.