(a) In any action for damages where the amount pleaded is $1,000 or less, and the plaintiff, when represented by counsel, prevails in the action, the plaintiff shall be allowed a reasonable amount to be fixed by the court as attorney fees for the prosecution of the action as a part of the costs of the action if the court finds that written demand for the payment of the claim was made on the defendant 20 days or more before the commencement of the action. However, attorney fees may not be allowed to the plaintiff if the court finds that the defendant tendered to the plaintiff before the commencement of the action, an amount not less than the damages awarded to the plaintiff.
(b) If the defendant, when represented by counsel, pleads a counterclaim that does not exceed $1,000, and the defendant prevails in the action, the defendant shall be allowed a reasonable amount to be fixed by the court as attorney fees for the prosecution of the counterclaim as part of the costs of the action.
(c) This section is subject to AS 45.50.537.