I'm fairly certain it's based on country of manufacture.
I've heard the opposite with a caveat--it depends upon if any work was done to the product in the intermediate country. In the tariff thread someone posted an article about the "Tijuana two-step," which is using Tijuana as an intermediary to avoid Chinese tariffs. Not sure why Tijuana is particularly attractive for this though because it can hypothetically work with any country. The loophole is this--if you're just passing a package through a country with no refinement and no repackaging then yes, you're supposed to pay the tariff on the country of manufacture and not the country it's coming from. But if you put a product into a package that says nothing about China then US Customs rarely has any way to know where the products inside of any given package were originally made and make no attempt to do so unless someone rats out a company who is exploiting this on some mass scale.
Many American companies are already planning to do the "two-step" approach of manufacturing in China, shipping to another country, doing a trivial amount of work to the product in that intermediary country or no work at all and just repackaging the products to not have Chinese shipping labels on them, and then importing from there. Or just repackaging from there and intentionally not disclosing where the majority of the product was made. Since many products are now partially manufactured in many different countries it's difficult or sometimes impossible to determine the cost of the parts that came from a country with a high tariff like China, so if work was done in the intermediate country then US Customs assigns the tariff for that country. This isn't a trivial step because you have to pay shipping charges to the intermediate country, plus you also have to pay tariffs into that country since almost every country has its own individual tariffs imposed on every other country just like the US does.
I don't think US Customs has any way of knowing where the items in a box coming from Japan were originally manufactured which is why none of the Japanese retailers who ship to America are mentioning these Chinese tariffs at all on their web sites. We also don't know who assembles Mafex figures into the box; if that's done in Japan then that avoids tariffs. My guess is everything is done in China, but once those products are in an AmiAmi box then US Customs is going to just let it go through. Envision an AmiAmi shipment with two figures in it--one Mafex manufactured entirely in China, and one from another company such as S.H. Figuarts that let's say hypothetically packaged the figure in Japan (my guess is that Bandai does everything in China, but for this example let's assume they don't). Going strictly by tariff law you'd just tariff the Mafex and not the Figuarts. Customs doesn't dig down to that detail level; they mostly just look at the labels on the package being shipped, and from the Japanese retailers that's going to just say Japan.
The de minimis tariffs will affect Inart and their new Dark Knight Rises Batman figure though since Inart is a Hong Kong company. I'm not sure any of us are going to get that figure, but hopefully I'm wrong. I'm hoping the Japanese retailers start stocking it, but I haven't seen that any are. Nerdzoic is the only US company I saw selling it, but with these new tariffs I bet people who pre-ordered there won't be getting that figure. I pre-ordered mine from a Chinese retailer, but I'm guessing that's going to fall through. Maybe the trade war will have ended by the time that figure releases, or at least that's my hope.