1. Was Imam Ali a.s. praying his nafilah prayer when he was struck or the fard prayer?
2. Where were Imam Hasan and Imam Husein and Hazrat Abbas present in the mosque during that time when Imam Ali was struck?

It’s very likely that Imam was praying his nafila, although it’s difficult to be sure as reports vary.
Imam Hasan was there but it’s likely that Imam Hussain was outside kufa for a task. We are not told whether Abbas was there or not in historical accounts