Elaborating devnull's approach leads to
{ c3=0; command3 || c3=$? && false; } && command4 || command5
echo $c3
.
Because every command
can be replaced by
{ c=0; command || c=$? && false; }
(provided that c
is initially unset if executed conditionally), this is easily extensible.