Help with Albumartist_country tag by inline

I’m doing a country based structure of the music.
There are some albums that have a main album artist but then some track have another artist (not being a Various Artist case), so when the folder is created, get some tracks splited in different folders.
So, what I’m trying to achieve is an Albumartist_country tag.
But I’m not sure how this could work.
Doing an inline with a album_fields (like the bitrate one), where if there are 9 tracks with artist_country x and three with different ones, then albumartist_country = x
Or it’s possible to ask somehow to make artist_country plugin search for the albumartist value as the artist to search in the database? Its possible to do this by the inline plugin?
Its possible to use a field from a plugin (as artist_country) inside other plugin as the inline?
Any help of how should be the way of action would be very much appreciated.

this far I made with my zero python but is not working:

album_fields:
albartctry: |
yes = 0
nop = 0
if albumartist = artist
yes = yes + 1
else :
nop = nop + 1
if yes > nop albartctry = 1 else 0

default: %if{$albartctry,%lower{$artist_country},%lower{$country}}/%the{$albumartist}($original_year)%title{$album%aunique{}}[$genre]/$discntrack-$title