Without interpreting the code, I'm just mentioning the syntax errors that you have:
if (%attackwin1 = 1) && (%attack1 >= %attack2) { set %attack11 %attack1 { set %attack22 %attack2 }}
To separate commands you use a pipe |, not an extra set of curly brackets (that you are not ending properly). So you simply want:
if (%attackwin1 = 1) && (%attack1 >= %attack2) { set %attack11 %attack1 | set %attack22 %attack2 }
set (%attack1 + %attack2) %numcount1
This too is incorrect, if you're trying to attach the value of %attack1 to the value of %attack2 then set the result as a global variable then you need to adapt it slightly:
set $+(%,%attack1,%attack2) %numcount1
if (%defend11 >= %attack11) { set %player2 (%player2 - 1) }
To perform a small calculation when setting a variable don't enclose the expression in parentheses:
if (%defend11 >= %attack11) { set %player2 %player2 - 1 }
Or simply:
if (%defend11 >= %attack11) { dec %player2 }
So start by going through and correcting these errors in all the places that they occur, then you could work on shortening it and perhaps using local variables (/help /var) so you don't end up cluttering your variables list. Also remember to view the help file on the areas you're dealing with to avoid these errors in the future
Edit: Just noticed another small error that needs correcting in a few instances:
if (%player2 >= 3) { set %attack3 ($rand(1,6)) }
You don't want those parentheses wrapped around the $rand(), it will stop the identifier from evaluating:
if (%player2 >= 3) { set %attack3 $rand(1,6) }