Issues referring to temporary values

I’m trying to implement a piece of code that repeats through all the clothing worn by the player and then checks if it has been worn for at least three turns:

Repeat with the article running through clothing worn by the player:
    if the article has been worn for at least three turns:
          etc.

However this returns the error:

I’d like to not have to implement counters for every single piece of clothing since there’s literally dozens.

Could you just implement a counter in a systematic way? Like “Every clothing has a number called the clothingcounter. The Clothingcounter of a clothing is usually 0. “

Yeah, I think that’s what I’ll do. I’ll probably use Every Turn rules to modify them like so:

To increase clothing counters:
	repeat with the article running through clothing worn by the player:
		increase the worn counter of the article by 1.
		
To reset clothing counters:
	repeat with the article running through clothing:
		unless the article is worn by the player:
			now the worn counter of the article is 0

Every Turn:
        increase clothing counters;
        reset clothing counters.

Repeat with the article running through clothing worn by the player:

You’re running into some ambiguous grammar here. The compiler wants to read this as “things which are clothing that the player has ever worn.”

You can instead write:

Repeat with the article running through worn clothing:

This will do what you want (assuming that “clothing” has been defined as a kind of thing). “Worn” as a bare adjective means “anything the player is currently wearing”.