Basic idea
The idea of stacking penalties (which I am familiar through Eve Online) is basically as follows: If there are multiple effects modifying a value, only the highest magnitude one has full effect and the rest have smaller and smaller percentage of their magnitudes applied. For example, if a character equips two rings, each with fortify strength 100, the first one would increase his strength by 100 but the second one would increase his strength by only 87 (using the Eve Online's values for the penalties). If he drinks a potion that has fortify strength 200, his total strength gain from the potion and the two rings would be = 200*1 + 100*0.87 + 100*0.57 = 314, instead of the actual 400. Note that the effects are sorted in decreasing order and increasing stacking penalties are applied as the effect magnitude gets smaller.
My suggested stacking penalties would be a bit harsher: 1, 0.5, 0.25, 0.125 ... , that is, the n th effect would have its magnitude multiplied by (0.5)^(n-1). This means that if a character keeps chugging Fortify Strength 100 potions, his total Strength increase after each potion would be roughly 100, 150, 175, 187, 193, 196, 198, 199 (rounded down), and would not increase any further (theoretically). More generally whatever number of however powerful effects you stack, the total increase would not be higher than the sum of the magnitudes of the first and second highest magnitude effects. This is just the initial idea and the stacking penalty values can be tweaked to make it more balanced.
Overall, the goal of this mod would be to limit the characters from growing arbitrarily strong/fast/whatever by stacking spell effects. Obviously, not all effects should get the stacking penalties treatment. For instance absorb, since it is not additive in the first place, scales well with multiple effects.
Implementation
My actual question is, would a mod like this be implementable, given the capabilities of the construction set and the user created script extenders? I have several ideas of how this might be implemented, but since I have no experience modding Morrowind and have only skimmed through one scripting guide, it would be great to have some input from the modding veterans on this subject. Below are several ideas in increasing order of implementability and decreasing order of functionality:
1- Ideally, a script that keeps track of all the different effects being applied on a value can be used to calculate what the total increase would have been if the stacking penalties were used, and then add a then brings down the value to the desired amount. Several issues:
(i) From what I gather, this kind of implementation seems to be impossible at the moment, even with the user created script enhancers, because there does not seem to be any support for arrays for variables (I'm not very knowledgeable in this area so it is very likely that I am missing something).
(ii) Even though we can access the total modified value, there does not seem to be any way to get the list of individual effects modifying the value. Would it be possible to reliably identify the magnitude of the individual effects by monitoring the changes in the total modified value? I assume that it might require some cooperation on the player's part as well, for instance by closing and opening the inventory screen between drinking multiple potions, so that the script can observe the attribute modification for each potion. On this subject, would it be possible to force-resume the game upon drinking a potion? How about after equipping a constant effect item? Even if these were possible, they would probably be too annoying for the players and maybe should be avoided anyway.
(iii) A very important issue is about how to reduce the actual value to a desired value. I assume it would be easy for attributes and skills by using drain and fortify effects, and it might even be possible to balance constant restore effects with damage effects (resist vs weakness, feather vs burden, etc.), but is there a way to do that for values that do not have such antagonistic spell effects, such as sanctuary, chameleon or reflect? If it is not possible to directly modify those, are there any workarounds? For instance, for sanctuary, I think fortifying the attack values of nearby NPCs might do the trick, but I don't know if something similar can be done for chameleon or reflect. Some others such effects that are worth mentioning are: Shield (and the elemental variants), Swift Swim, Levitate, Dispel, Telekinesis and Fortify Attack.
2- Assuming there is no support for arrays, the next best thing would be to keep track of the k highest magnitude effects, using k variables, for a fixed k (4 seems to be a good number). We can either disregard the rest of the modifiers, or ensure that their total contribution is no more than the contribution of the k th highest modifier (after applying the penalty).
3- Assuming there is no support for arrays and there is no way to identify individual modifiers, we can instead figure out the total change in value (that is, modified value - base value) and compute a more balanced value as a function of this total change. One possible idea is to divide the total change into chunks of size X (different for each value, for instance maybe 200 for feather and only 10 for fortify skill), and apply the stacking penalty to these chunks. Essentially, this would assume that there would be a number of individual effects, each modifying the value by X (except for one with a magnitude smaller or equal to X). The problem in this case would be that the maximum possible total magnitude would be dependent on X and not on the magnitude of the highest magnitude effect, which means an X must be figured out for each of the relevant modifiable values. This might be handled gracefully as well, by using the base cost of the associated spell effects to compute X, which means it should work with mods that modify the base cost of spell effects, such as Wakim's or BTB's game improvements. A straightforward way for computing X might be to set it to 50/B, where B is the base cost for that attribute.
An example for the third idea: Following the example above with two rings and one potion, the total Fortify Strength effect would be 400. If we were using a mod that modifies the base cost of Fortify Strength to be 0.2 (just for the sake of this example), we would get X = 50/0.2 = 250. The script would then assume that there are two separate effects modifying the total strength, one with magnitude 250, the other with magnitude 150, for a total of 400. It would compute the desired value as 250 + 150*0.5 = 325 and reduce the net effect from 400 to 325, possibly by adding Drain Strength 75.
Anyway, that is all for now. Any feedback would be very much appreciated. As far as I know, there is no mod that does this. Also, I assumed that this forum is the most active modding forum around, does anyone know other forums where I can get feedback on these ideas?