Social Order Maintenance Act Article 12

Any behaviors, out of defending one’s or the other’s rights against immediate illegal aggression, shall not be punishable.
中文原文 社會秩序維護法第12條
對於現在不法之侵害,而出於防衛自己或他人權利之行為,不罰。

English translation for reference only; the Chinese text prevails. Not legal advice.