@Summer Sun
There is a NetSuite bundle that shows this but the implementation and performance is questionable to say at least.
This is not going to be an straight forward script, it will require delicate craft.
It could be something like this:
Map Reduce Script:
• getInputData:
◦ Search all items that are member of (an assembly), calculate the cost.
◦ Continue to do this recursively in reverse order.
◦ This give you the cost per Assembly.
◦ Store the cost per assembly.
• Map:
◦ Update any assembly cost you previously calculated.
This is simply an idea... but something along those lines should work.